<template>
	<view class="box">
		<image src="https://ma.zhidun.vip/xcx/zd_analy.png" mode="scaleToFill" style="width: 100%;height: 360rpx;"></image>
		<!-- <view class="content">
			<text>青岛海关技术中心 技术支持</text>
			<view class="imgtop">
				<image src="/static/img/zhidun_logo.png"></image>
				<view>
					<text>进口商品质盾防伪溯源体系</text>
					<text>Import ZhiDun Traceability System</text>
				</view>
			</view>
		</view> -->

		<view class="scanview">
			<image src="https://ma.zhidun.vip/xcx/btn.png" mode="scaleToFill" @click="scanQrCode"></image>
			<text @click="scanQrCode">扫码查询</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		onLoad() {

		},
		methods: {
			scanQrCode() {
				let that = this;
				// 允许从相机和相册扫码
				uni.scanCode({
					success(res) {
						const BoardNo = encodeURIComponent(res.result)
						console.log(BoardNo);
						uni.navigateTo({
							url: '/pages/search/index?url=' + BoardNo
						})
					}
				});
			},
		}
	}
</script>

<style lang="scss">
	.box {
		.content {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			height: 300rpx;
			background-image: url("https://ma.zhidun.vip/xcx/zd_analy.png");
			background-repeat: no-repeat;
			background-size: 100% 100%;
			-moz-background-size: 100% 100%;

			&>text:first-child {
				color: white;
				font-size: 40rpx;
				margin-bottom: 20rpx;
			}

			.imgtop {
				display: flex;
				padding: 16rpx 80rpx;
				background-image: url("");
				background-repeat: no-repeat;
				background-size: 100% 100%;
				-moz-background-size: 100% 100%;

				&>image:first-child {
					flex: 1;
					width: 72rpx;
					height: 100rpx;
					margin-right: 20rpx;
				}

				&>view:nth-child(2) {
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;

					&>text:nth-child(1) {
						color: #fff;
						font-size: 32rpx;
						margin-bottom: 10rpx;
					}

					&>text:nth-child(2) {
						color: #fff;
						font-size: 24rpx;
					}
				}
			}
		}

		.scanview {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;

			&>image {
				display: block;
				width: 600rpx;
				height: 432rpx;
				margin-top: 70rpx;
			}

			&>text {
				background-color: #1374DC;
				color: #fff;
				border-radius: 44rpx;
				padding: 20rpx 200rpx;
				text-align: center;
				font-size: 36rpx;
				margin-top: 100rpx;
				font-weight: 700;
			}

		}


	}
</style>